package com.ff.neuropp.controller;


import com.ff.neuropp.domain.Order;
import com.ff.neuropp.service.AppOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


/**
 * app订单接口
 */
@RestController
@RequestMapping("/app/order")
@Api(value = "app订单controller", tags = {"app订单接口"})
public class AppOrderController {

    @Autowired
    private AppOrderService orderService;

    @PostMapping("/create")
    @ApiOperation(value = "创建预支付订单", notes = "创建预支付订单")
    public Map<String,Object> createOrder(@RequestBody Order param){
        return orderService.createOrder(param);
    }



    @PostMapping("/update")
    @ApiOperation(value = "更改订单状态", notes = "更改订单状态")
    public Map<String,Object> update(@RequestBody Order param){
        return orderService.update(param);
    }



    @GetMapping("/info")
    @ApiOperation(value = "订单信息", notes = "订单信息")
    public Map<String,Object> info(@ApiParam(required = true,value = "订单号") @RequestParam String orderNum){
        return orderService.query(orderNum);
    }

}
